UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dZyr/eRLnxs084SEZ7C0J52iwkzKVWi72FuL67Sffy4=' 
WHERE 
  key_id = '44c7f261b8b3e5b1cb957d169a4c1f055428468a01c05784b4554ff1cf3e8086' 
  AND (
    token = 'dZyr/eRLnxs084SEZ7C0J52iwkzKVWi72FuL67Sffy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035