UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v1gUx9UcYNsHI/l22WNLweymZ3PrMIFB8HmYf9rmCUw=' 
WHERE 
  key_id = '4d937f2d33695808cdbe1b02ea367e2c63dc7011c50cb96c15ffbcb723f2a660' 
  AND (
    token = 'v1gUx9UcYNsHI/l22WNLweymZ3PrMIFB8HmYf9rmCUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041