UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aZi8HvSpBOz0mniZjNYNNEH2YeqTYM6D/bwkvvz/zSk='
WHERE
key_id = '6c6d377c249c7e6db1be6b84896d8559c9be6e3ec694f79df2a7a30357102a4e'
AND (
token = 'aZi8HvSpBOz0mniZjNYNNEH2YeqTYM6D/bwkvvz/zSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)