UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/fewFnNp6ktp5il+XV2+jUUiyk8ovNxVcJ6WrCcgMA='
WHERE
key_id = '4801087a9da9c978e2693e993cbb03108a609cf87d5d619f8247a3db7c95a9e8'
AND (
token = 'p/fewFnNp6ktp5il+XV2+jUUiyk8ovNxVcJ6WrCcgMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)