UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kOs8xbp9HK6K28bG7zRZOqsRorKxwJnoTpEbV9ViJjE=' 
WHERE 
  key_id = '97bc952ef63fda134e60499e2309eb30b73cb4a7da65e92f82ca855dc4ba1e68' 
  AND (
    token = 'kOs8xbp9HK6K28bG7zRZOqsRorKxwJnoTpEbV9ViJjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030