UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnvaemmKzW2R9zWUK1Seuvqu4RQd8in1f3iUvwAH1EM=' 
WHERE 
  key_id = '9dfcf599c09dca5b52f7e9f701b64d13a05f753a1e45719d6ec91df24608c2d2' 
  AND (
    token = 'ZnvaemmKzW2R9zWUK1Seuvqu4RQd8in1f3iUvwAH1EM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023