UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mXc9HwYK+wOMy6RAvZPCDXC6OZmSjmzum1zA9cC1VaU='
WHERE
key_id = '204c3efc10db634b855e02fadea75645a6e9d2ba5e75e0616615640fc0a76911'
AND (
token = 'mXc9HwYK+wOMy6RAvZPCDXC6OZmSjmzum1zA9cC1VaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)