UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FXMEQ6OSO4rVpPoF4xzf+AHwrlY0BxBgfOFc2twDrac=' 
WHERE 
  key_id = 'f09b26fd877710742004cf06cb0ebf24a1c7afe691036a26ce3ceae1032e8862' 
  AND (
    token = 'FXMEQ6OSO4rVpPoF4xzf+AHwrlY0BxBgfOFc2twDrac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024