UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcvkrFhVSw5T5biJirJKc8Z1luOvjDGxGVRGN+unyvI=' 
WHERE 
  key_id = '5d45ca6fec400dd0dd6d25ae34b700badb2c4b347062c99449e4c6c541161fa9' 
  AND (
    token = 'WcvkrFhVSw5T5biJirJKc8Z1luOvjDGxGVRGN+unyvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021