UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4uZhBZ45zPl8DqNwkVzioeEuXwfJgEcwKj9fBcyJFjA='
WHERE
key_id = '3c442161a45055bca64ee65f262b9659b6c4746cc8c549fd023df22979ba491f'
AND (
token = '4uZhBZ45zPl8DqNwkVzioeEuXwfJgEcwKj9fBcyJFjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)