UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xi/61qJ2aoqjcdx8LWA4zUjHa7GdHWfWCt+iIqg7O/w='
WHERE
key_id = '45b79ba518534b31394ccbd5aaad8147bc2a908ff31d9bcf307d5034fa00e5b1'
AND (
token = 'xi/61qJ2aoqjcdx8LWA4zUjHa7GdHWfWCt+iIqg7O/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)