UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lv6A/pluxp8k4nEE2j1jP37QgQyKGl8rnRsiOC54cws='
WHERE
key_id = '9be4d8f0a566a765cf684c7e7f852fd86a53819f4db58fb4a30cde28f03f330b'
AND (
token = 'Lv6A/pluxp8k4nEE2j1jP37QgQyKGl8rnRsiOC54cws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)