UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KSelQTKLDjTkvVYYFcQ9hVFLdqQ0c/X/xBDOwrj1k4I='
WHERE
key_id = 'ee82a2bb332847e47a0fa814d71197c66d447fdea1badcb2a864cc2949a78aaf'
AND (
token = 'KSelQTKLDjTkvVYYFcQ9hVFLdqQ0c/X/xBDOwrj1k4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)