UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9jmMaNLRaiv0BeaDQuwOmr2tf31D2hgXCihUcCHHwjA='
WHERE
key_id = '80674eb8cc5b3fd0fb623c2e452e1d6a4c9b25c4150061749e89caf66b3c9d2c'
AND (
token = '9jmMaNLRaiv0BeaDQuwOmr2tf31D2hgXCihUcCHHwjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)