UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ThiJI+mm1WtT/orAgJPf8fxik4ko/qhNDPsRwyb2Se0=' 
WHERE 
  key_id = '69c401f5c144657b5b5f85e4dc7fc5ab2a6daa2b4e968ea6f0fd9271b22a4d75' 
  AND (
    token = 'ThiJI+mm1WtT/orAgJPf8fxik4ko/qhNDPsRwyb2Se0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036