UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VsSUgz5ikpp9VNjckEb5Rfek6YKFEBetZy2b+Fp6U3Y=' 
WHERE 
  key_id = 'dd2a76fab8bed33f4492287c88bb63c3baa3ee72be5e1f66e5e27e1adfba2095' 
  AND (
    token = 'VsSUgz5ikpp9VNjckEb5Rfek6YKFEBetZy2b+Fp6U3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022