UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TVG5+o4IkbO+Tj+TgnRA05+hziLXBk/zrSeyKhuTpBI=' 
WHERE 
  key_id = '1b7a440a2392af99f2f95b34f407f9a21bcbc48c1f8a4f59fa42df2854a970e0' 
  AND (
    token = 'TVG5+o4IkbO+Tj+TgnRA05+hziLXBk/zrSeyKhuTpBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015