UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZixPgXh1neXZGKMoh7xpIDjlb+BGxZ+ddKRJXIxDzNY='
WHERE
key_id = 'f275a31adacafb369107deb32b515969eb577513b569d4c32a250a16b4dc1e36'
AND (
token = 'ZixPgXh1neXZGKMoh7xpIDjlb+BGxZ+ddKRJXIxDzNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)