UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K3E+jZoYPTqyQ3FQBwz67ADfHsI6K8DfOeujeTuYZgk='
WHERE
key_id = '0f264d34bc9646eeb240f058155007f03d7638e94faaaab86808d620d4a01803'
AND (
token = 'K3E+jZoYPTqyQ3FQBwz67ADfHsI6K8DfOeujeTuYZgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)