UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xOnwyX4HCc4C116ZfAeUG9rU8Stlc8oYWRkdWgeowJA=' 
WHERE 
  key_id = '957f52c8e05d87f742a1fdc0d7d4d075753c809a4ea20945ef624b2f980ff3a5' 
  AND (
    token = 'xOnwyX4HCc4C116ZfAeUG9rU8Stlc8oYWRkdWgeowJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053