UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9H1X4eRJsaa4+RyknKbb9wY+h4OZuPX4INoHu7sTOY='
WHERE
key_id = 'c67a60db22a6e94999bb238b532a09fc2c073c076dbc69fd852caa8982f86fef'
AND (
token = '+9H1X4eRJsaa4+RyknKbb9wY+h4OZuPX4INoHu7sTOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)