UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zoh/lzu6rNNlXHkdauTgCDyV4dC3aoHFWynuXO10AfY='
WHERE
key_id = '8b6915cccfe6430074630bec168124ce51ea7ba6e52b8c2046652299a8480f13'
AND (
token = 'Zoh/lzu6rNNlXHkdauTgCDyV4dC3aoHFWynuXO10AfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)