UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lrnica4NSMMJDbqUZdS9OC9K3da8sSmBvUFglQvBQAs='
WHERE
key_id = 'b03b8b4a30b8302bdae8b5d23a93913ff03a3c83185915310802be42d654e82a'
AND (
token = 'Lrnica4NSMMJDbqUZdS9OC9K3da8sSmBvUFglQvBQAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)