UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IkYIgDeMLBzo0keHN/U2vXnjma4McoeNQloQun0hsuM=' 
WHERE 
  key_id = 'bcc9f00b8deeec412296d9e9844039e14022be621778fc17ff9f7f5e5182f488' 
  AND (
    token = 'IkYIgDeMLBzo0keHN/U2vXnjma4McoeNQloQun0hsuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021