UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hnLk4xeiW+vaqyDqdUJxSVwCbUJHOIVgNnM84Z2kJ1Y=' 
WHERE 
  key_id = 'fb9b6741f93b8245700cd97e1382942cb443e579974a42e2619c8f05d15f5fa9' 
  AND (
    token = 'hnLk4xeiW+vaqyDqdUJxSVwCbUJHOIVgNnM84Z2kJ1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028