UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+gZv7SKz+WYxARJoMQsSwb1XvbfRs7DDAA/TQKFsLI8='
WHERE
key_id = '91ca6fa4c28493fb3db7208ec59bf418842bc17d88269857124b0466a79ada82'
AND (
token = '+gZv7SKz+WYxARJoMQsSwb1XvbfRs7DDAA/TQKFsLI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)