UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9f/06P9Kl1QAum4J4KRU1dolXwvqbN/kwrl/93DAGmw=' 
WHERE 
  key_id = '57ef2e95b33bdf35f5c0b33e6331f045d005d021847c5f0c42358e63b20b3e27' 
  AND (
    token = '9f/06P9Kl1QAum4J4KRU1dolXwvqbN/kwrl/93DAGmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034