UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4yq7Xu/1KFAKeUyXkb0ESg/V6KSnxfvhYWy0CAWBE9s=' 
WHERE 
  key_id = '95c6fbc2d83d2baec7196acd728f2cda8bf37486a15a070cc98f78b0dcf15b46' 
  AND (
    token = '4yq7Xu/1KFAKeUyXkb0ESg/V6KSnxfvhYWy0CAWBE9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026