UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I0Kt1UQ67UTxw2peP1Z8e5dIH/ForkzpWxweQTsOMDE=' 
WHERE 
  key_id = '1d46c2f71ebf2f7e2fab6c77ba3be323b6aaa68f02420b324810b557ea76348d' 
  AND (
    token = 'I0Kt1UQ67UTxw2peP1Z8e5dIH/ForkzpWxweQTsOMDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046