UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Jrqnn8b6qQ3+8liXxvuxs8f6mAwGDbTi4GWe1oQ9DM='
WHERE
key_id = '8e80008b929577941ca235d49837034adca257d1bf56fd5d937ef9545ec5e48e'
AND (
token = '5Jrqnn8b6qQ3+8liXxvuxs8f6mAwGDbTi4GWe1oQ9DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)