UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YteMinXl6BeKmLCzKt4QtOJFVaDHNyQ3EuCm6dYakgQ='
WHERE
key_id = '9de17d973e63e5628d8fc1d0feabb569529b747c2c5ef1fd5c097db7a6fa9387'
AND (
token = 'YteMinXl6BeKmLCzKt4QtOJFVaDHNyQ3EuCm6dYakgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)