UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhcrkhB/WnqUVKKWMXBNQ7JptXXW0GxHRb7m0nJG1Bc='
WHERE
key_id = '10a83fb03b2c0d51dac94341ba6c16dead43f46780dde9650a119b28588689b1'
AND (
token = 'GhcrkhB/WnqUVKKWMXBNQ7JptXXW0GxHRb7m0nJG1Bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)