UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4P7/S4rYs46lGC0xaFK2REf5BOd0Iuaio8QWAO3aneA=' 
WHERE 
  key_id = '6bdc37052ea0a51034e6731a613e6cfecdfe3ee5058dfaf24628599e809e8b73' 
  AND (
    token = '4P7/S4rYs46lGC0xaFK2REf5BOd0Iuaio8QWAO3aneA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031