UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'To4eA/2WOosU8n46Neh6ZUhtSqgZKzfsTFw7lzPkWBI=' 
WHERE 
  key_id = '2763d086149a398746b6479224f1549696e4f61c45fbf6f46582f8b6b61db122' 
  AND (
    token = 'To4eA/2WOosU8n46Neh6ZUhtSqgZKzfsTFw7lzPkWBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026