UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8QPQmAZAPz3pnCy3+WPaLDcMiRj/43oAyxT2BGtHfbw='
WHERE
key_id = '9108a6cfc772cc41aba2dcb96ccc2dfe7c1221ceddc8145755aab39c998ba72e'
AND (
token = '8QPQmAZAPz3pnCy3+WPaLDcMiRj/43oAyxT2BGtHfbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)