UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8bQZ9VOxSbIv0XpvCMUC/5NogyMD2K1nS1t1cJISTsg=' 
WHERE 
  key_id = '70ef24aa7c71d4ec428553722b9c9ec20de53804d99731eceea240a4987d607e' 
  AND (
    token = '8bQZ9VOxSbIv0XpvCMUC/5NogyMD2K1nS1t1cJISTsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036