UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zJTLwhIIw5pnEI0BMJr9zuuN4Nqk7PZif952+A80DWw=' 
WHERE 
  key_id = '189eea27997b853a6fe49a2e3661cace45f9eedb0112e902d86672d84b30c63d' 
  AND (
    token = 'zJTLwhIIw5pnEI0BMJr9zuuN4Nqk7PZif952+A80DWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050