UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOUlCjqHrXs+gTLAsGDv6nhRI9ktZNd/xD9g29Yt/14='
WHERE
key_id = '9c7634060192b8c1b964d37ac8bdc803a650a03148e33968b25b599f24ba1385'
AND (
token = 'yOUlCjqHrXs+gTLAsGDv6nhRI9ktZNd/xD9g29Yt/14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)