UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Qu8YnqIbSaPB/QQuLQubTJt6APMB0fiFhEFIUMlGCM='
WHERE
key_id = '4aca7e9c57f3f5316c6b3160cff48801f2c715fcf8106014a6ddc7ffe65f4567'
AND (
token = '0Qu8YnqIbSaPB/QQuLQubTJt6APMB0fiFhEFIUMlGCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)