UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5z/wnxIBTnM//uL44leR5ybZnexT6nYNiDadx/Uy0BI=' 
WHERE 
  key_id = '0639bf50206394fba5a0b3c7dfec6b564ededf4cc76080c3debeedb2de655943' 
  AND (
    token = '5z/wnxIBTnM//uL44leR5ybZnexT6nYNiDadx/Uy0BI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030