UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9+GxHAaelK61yIfh4zsJS2xbg+DEpWgoyGGQJOH9+fU='
WHERE
key_id = 'c4a1b6a32a1cb0fcfbf542ff0cad76ceb81bdf577bba05fdf485b885f2d89ca0'
AND (
token = '9+GxHAaelK61yIfh4zsJS2xbg+DEpWgoyGGQJOH9+fU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)