UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tabNWEHEjLLON9T3UtDHNQjGavJjIbFWqUlLCakbuCE=' 
WHERE 
  key_id = '2fbf053604d072aa8172d0fe5d15fd7dea0e9d7cd115f42b4d621441c05c0257' 
  AND (
    token = 'tabNWEHEjLLON9T3UtDHNQjGavJjIbFWqUlLCakbuCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031