UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c6IQRb89U+GbpkHFYWC55WPBo79PF5ba9u3il5dEU88='
WHERE
key_id = '182ad7744d914ce6ecf3786bbf6f8bd2fda4d8b919e0c0fcac433e54edd56d29'
AND (
token = 'c6IQRb89U+GbpkHFYWC55WPBo79PF5ba9u3il5dEU88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)