UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RxqPF5vgC7HinLGXT3ti2l8liWH5AnhiLsM08lGA7MQ='
WHERE
key_id = '884862ed41e04c9750f17b98bf9b571dcd2ca122c0c0d5c8452ea1438925d07a'
AND (
token = 'RxqPF5vgC7HinLGXT3ti2l8liWH5AnhiLsM08lGA7MQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)