UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmnPNHZntTKf3QjiuOaxF7qc4mL+8eGQGl99PLCK49c=' 
WHERE 
  key_id = '6b2c54d2c6c0ae85efe628396b482822ce881e4637c15878782a5e6d3ed1cf0d' 
  AND (
    token = 'wmnPNHZntTKf3QjiuOaxF7qc4mL+8eGQGl99PLCK49c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023