UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mw21brIt7QCVQHtSzUakSkcP5SL+Nf/Qi3p4YdXaBhw=' 
WHERE 
  key_id = 'b80491e13684f219f4c154d83f2c991fe000f1fff5ec08e13e07f76071fa06a4' 
  AND (
    token = 'Mw21brIt7QCVQHtSzUakSkcP5SL+Nf/Qi3p4YdXaBhw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049