UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OfKp/WyRi9cDsoIYqwUbafiRG1DjEORKoO9DgRji2W0=' 
WHERE 
  key_id = '8ff4f4afc9b46ce045a9427a57f9a758aaf6383bf1beb5048057bdcb352c85bf' 
  AND (
    token = 'OfKp/WyRi9cDsoIYqwUbafiRG1DjEORKoO9DgRji2W0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023