UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F4yYp3wQXpzRVUntKKQfqi+RcAf7ASgXWZsFaEQEaZo=' 
WHERE 
  key_id = '848d47ad4bf5cc5fc312cd915d14b6cbf73f0c6517a47b88a18a168f45d4196c' 
  AND (
    token = 'F4yYp3wQXpzRVUntKKQfqi+RcAf7ASgXWZsFaEQEaZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021