UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LfEigWmd4HPBdQkkr+Ap2SMro1eeme3ecKD0jN/OkjU=' 
WHERE 
  key_id = '750e18cad99724e5bff4966a2899eaa832e18a2e8f3e813791aeb54936d63938' 
  AND (
    token = 'LfEigWmd4HPBdQkkr+Ap2SMro1eeme3ecKD0jN/OkjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037