UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KZYrMSeIEmxOsurHUIUDZ0stYdEP/js4HkXZ08GkyRM='
WHERE
key_id = 'ff6d9a4691294a3ccca1b7df0f245dd41bfe0b7c669bb85a51d87a0771318293'
AND (
token = 'KZYrMSeIEmxOsurHUIUDZ0stYdEP/js4HkXZ08GkyRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)