UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nBlcqgQEN3zU2FeNmLHYrgy+1Y0cfC7xVe4GllZf9Ys='
WHERE
key_id = 'bacd3ee9d0d2efdf35a8cdcc676f1b24368a093a3267c206d2ef6d02f2321bc6'
AND (
token = 'nBlcqgQEN3zU2FeNmLHYrgy+1Y0cfC7xVe4GllZf9Ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)